package com.originit.product.server.exception

import com.originit.product.server.enums.ResultEnum
import java.lang.RuntimeException

val DEFAULT_CODE = -1


class ProductException(override var message:String?, var code:Int = DEFAULT_CODE) :RuntimeException() {

    constructor(result: ResultEnum, message:String? = null) : this(message) {
        if (message == null) {
            this.message = result.message
        }
        this.code = result.code
    }


    constructor(code:Int, message:String) : this(message, code)
}